package io;

import java.io.*;

/**
 * s适用对象输入流完成对象的反序列化操作
 */
public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fis = new FileInputStream("person.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);
        /**
         * 对象输入流提供了反序列化操作
         * object readObject()
         */
        Person p = (Person) ois.readObject();
        System.out.println(p);
        ois.close();
    }
}
